package com.foreverwin.mes.common.service.impl;

import com.foreverwin.mes.core.base.FrontPage;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.foreverwin.mes.common.model.PrintLog;
import com.foreverwin.mes.common.mapper.PrintLogMapper;
import com.foreverwin.mes.common.service.PrintLogService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * <p>
 * 打印记录 服务实现类
 * </p>
 *
 * @author Ervin Chen
 * @since 2020-03-06
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class PrintLogServiceImpl extends ServiceImpl<PrintLogMapper, PrintLog> implements PrintLogService {


    @Autowired
    private PrintLogMapper printLogMapper;

    @Override
    public Page<PrintLog> selectPage(FrontPage<PrintLog> frontPage, PrintLog printLog) {
        EntityWrapper<PrintLog> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(printLog);
        return super.selectPage(frontPage.getPagePlus(), queryWrapper);
    }

    @Override
    public List<PrintLog> selectList(PrintLog printLog) {
        EntityWrapper<PrintLog> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(printLog);
        return super.selectList(queryWrapper);
    }


}